import { PartnerModel } from './partner'
import { CertificateModel } from './certificate'
import dayjs from 'dayjs';

export interface CreateConnectionParams {
  type: string;
  partner_name?: string;
  app_register_app?: string;
  start_time: dayjs.ConfigType;
  end_time: dayjs.ConfigType;
}

export interface UpdateConnectionParams {
  start_time: dayjs.ConfigType;
  end_time: dayjs.ConfigType;
}

export interface UpdateConnectionStateParams {
  state: string;
}

export interface GetConnectionListParams {
  state: string;
  search: string;
}

export interface ConnectionModel {
  id: number;
  state: string;
  partner: PartnerModel;
  our_side_certificate: CertificateModel;
  other_side_certificate: CertificateModel;
  start_time: string;
  end_time: string;
  wwexx_id: string;
  created_at: string;
  updated_at: string;
  latest_pull_data_at: string;
}

export interface ConnectionSimpleModel {
  id: number;
  state: string;
  partner: PartnerModel;
}

export interface GenerateCertificateParams {
  connection_id: number|string;
  server: string;
  entities: string;
}

export interface ValidateCertificateParams {
  certificate_id: number;
}

export interface CertificateServerModel {
  server: string;
}